r = 1 gotdoll = 1 demon = 1 SCREEN 12 COLOR 7, 0 CLS DIM SHARED DOOM AS DOUBLE Minutes = 10 Seconds = 0 GameTime = Minutes * 60 + Seconds DIM directions(1 TO 9) AS STRING directions(1) = "SOUTH" directions(2) = "NORTH OR EAST" directions(3) = "WEST OR EAST" directions(4) = "WEST OR SOUTH" directions(5) = "NORTH OR SOUTH" directions(6) = "WEST" directions(7) = "NORTH OR WESTN" directions(8) = "NORTH OR EAST" directions(9) = "SOUTH" PRINT "" PRINT "" PRINT "This doll...this damn doll...it's evil, it must be? Ever since you" PRINT "were given it one day, it has brought you nothing but bad luck." PRINT "" DO: LOOP UNTIL INKEY$ <> "" DOOM = TIMER(0.001) + GameTime 'change this to to desied time for the game to run DO CLS PRINT PRINT PRINT " " PRINT " " PRINT " " PRINT " The Curse " PRINT " " PRINT " Written by " PRINT " " PRINT " D.B. Taylor" PRINT "" PRINT " Copyright (c) 2015" PRINT "" PRINT SPACE$(38); IF INSTR(directions(r), "NORTH") THEN PRINT "N" ELSE PRINT PRINT "*---------------------------------* "; IF INSTR(directions(r), "WEST") THEN PRINT "W"; ELSE PRINT " "; PRINT " + "; IF INSTR(directions(r), "EAST") THEN PRINT "E"; ELSE PRINT " "; PRINT " *------------------------------------*" PRINT SPACE$(38); IF INSTR(directions(r), "SOUTH") THEN PRINT "S" ELSE PRINT PRINT PRINT "If you are stuck just type HELP." PRINT GOSUB ROOM GOSUB parser LOOP ROOM: IF r = 1 THEN: GOSUB r1 IF r = 2 THEN: GOSUB r2 IF r = 3 THEN: GOSUB r3 IF r = 4 THEN: GOSUB r4 IF r = 5 THEN: GOSUB r5 IF r = 6 THEN: GOSUB r6 IF r = 7 THEN: GOSUB r7 IF r = 8 THEN: GOSUB r8 IF r = 9 THEN: GOSUB r9 RETURN parser: PRINT "> "; cmd$ = GrabInput cmd$ = LTRIM$(RTRIM$(UCASE$(cmd$))) IF cmd$ = "END" OR cmd$ = "QUIT" OR cmd$ = "EXIT" OR cmd$ = "Q" THEN END END IF IF cmd$ = "HELP" OR cmd$ = "H" OR cmd$ = "?" THEN CLS PRINT "HERE ARE SOME BASIC COMMANDS THAT CAN BE USED IN THE GAME..." PRINT PRINT "NORTH, EAST ,SOUTH, AND WEST - MOVE TO AN AVAILABLE LOCATION" PRINT "EXAMINE (OBJECT) - EXAMINE AN OBJECT" PRINT "USE (OBJECT) - USE AN OBJECT" PRINT "TAKE (OBJECT) - TAKE OR MOVE AN OBJECT" PRINT "INVENTORY - VIEW YOUR INVENTORY" PRINT "DRINK - DRINK BEER" PRINT "UNLOCK - UNLOCK DOOR" PRINT "HELP - VIEW THIS SCREEN" PRINT "END - END GAME" PRINT PRINT "PRESS ANY KEY...": SLEEP DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "INVENTORY" OR cmd$ = "INV" OR cmd$ = "ITEMS" OR cmd$ = "I" THEN CLS PRINT "INVENTORY..." PRINT IF gotdoll = 1 THEN: PRINT "The crused doll." PRINT PRINT "PRESS ANY KEY..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "GO NORTH" OR cmd$ = "NORTH" OR cmd$ = "N" THEN IF r = 2 THEN: r = 1: GOTO moved IF r = 7 THEN: r = 5: GOTO moved IF r = 5 THEN: r = 4: GOTO moved IF r = 8 THEN: r = 9: GOTO moved END IF IF cmd$ = "GO EAST" OR cmd$ = "EAST" OR cmd$ = "E" THEN IF r = 2 THEN: r = 3: GOTO moved IF r = 3 THEN: r = 4: GOTO moved IF r = 5 THEN: r = 6: GOTO moved IF r = 8 THEN: r = 7: GOTO moved END IF IF cmd$ = "GO SOUTH" OR cmd$ = "SOUTH" OR cmd$ = "S" THEN IF r = 1 THEN: r = 2: GOTO moved IF r = 4 THEN: r = 5: GOTO moved IF r = 5 THEN: r = 7: GOTO moved IF r = 9 THEN: r = 8: GOTO moved END IF IF cmd$ = "GO WEST" OR cmd$ = "WEST" OR cmd$ = "W" THEN IF r = 4 THEN: r = 3: GOTO moved IF r = 3 THEN: r = 2: GOTO moved IF r = 6 THEN: r = 5: GOTO moved IF r = 7 THEN: r = 8: GOTO moved END IF IF (cmd$ = "EXAMINE DEMON") AND r = 9 THEN CLS PRINT "A black figure. It doesn't appear to be wearing anything. You" PRINT "can't even make out it's facial features." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE DOLL") AND gotstake = 1 THEN CLS PRINT "A handcrafted wooden doll. It's face is painted on and is" PRINT "already cracking and peeling off. What an ugly thing." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "THROW DOLL") AND gotdoll = 1 AND r = 9 THEN CLS GOTO win: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "KEEP DOLL") THEN CLS GOTO lose: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF moved: RETURN r1: PRINT "You are standing at the entraceway of a wooden area. The sky is" PRINT "gray and looks as if a storm is on it's way." RETURN r2: PRINT "Walking through the thick brush. You feel something in the distance" PRINT "is watching you." RETURN r3: PRINT "The narrow path no wider then a few feet. Its hard to get a footing" PRINT "on this trail. But it'll be worth it at the end." RETURN r4: PRINT "You hear birds calling out to one another. Though they grow weak" PRINT "as if they are leaving you in silence." RETURN r5: PRINT "Nothing, nothing but silence. Not a twig snapping or the cry of" PRINT "an animal. It's as if you are alone in this God forsaken world." RETURN r6: PRINT "You are over looking a vast society of tree's. Not touched by human" PRINT "hands. How lovely." RETURN r7: PRINT "You hear the cry of someone. It's as if you are being hunted." RETURN r8: PRINT "You wander out from the thick wall of tree's. You see it...finally" PRINT "you've reached the point of where you must throw this damned object" PRINT "back into the pits of destruction." RETURN r9: PRINT "A large pit, a sink hole maybe? Standing next to you is a foul" PRINT "creature, the being living within the wood flesh of the doll. A" PRINT "demonic being, who prays on those who keep it's wooden body." RETURN win: COLOR 2, 0 CLS PRINT "You plunge the doll into the darkness, you watch as the doll is" PRINT "swollowed by the Earth. The demonic visitor, looks upon you, and" PRINT "jump into the void. Now maybe your life can finally be back on" PRINT "track." PRINT "" DO: LOOP UNTIL INKEY$ <> "" END lose: COLOR 2, 0 CLS PRINT "A power overcomes you and soon you find yourself returning home with" PRINT "the doll in the passenger seat. The demonic being, sitting in the back." PRINT "Laughter fills the car as the storm unleashes it's powers upon the world" PRINT "around you." PRINT DO: LOOP UNTIL INKEY$ <> "" END FUNCTION GrabInput$ x = POS(0) y = CSRLIN maxwidth = _WIDTH - x PCOPY 0, 1 'make a backup copy of the screen DO k = _KEYHIT i$ = INKEY$ LOOP UNTIL k = 0 AND INKEY$ = "" 'clear the keyboard buffer DO _LIMIT 30 PCOPY 1, 0 LOCATE y, x: PRINT Userinput$ k = _KEYHIT SELECT CASE k CASE 8 Userinput$ = LEFT$(Userinput$, LEN(Userinput$) - 1) CASE 65 TO 90, 97 TO 122, 32 Userinput$ = UCASE$(Userinput$ + CHR$(k)) END SELECT timerleft## = (DOOM - TIMER(0.001)) minutes = timerleft## \ 60 seconds = timerleft## - minutes * 60 LOCATE 2, 32: PRINT USING " ###:##.###"; minutes, seconds IF timerleft## <= 0 THEN GOTO doomed _DISPLAY LOOP UNTIL k = 13 GrabInput$ = Userinput$ _AUTODISPLAY EXIT FUNCTION doomed: CLS PRINT "Night has arrived and you are alone in the woods. You get lost...they" PRINT "never find you again." _DISPLAY END END SUB